import { useStore } from "@/store";

// pageName当前的请求，handle事件
export function usePermission(pageName: string, handle: string) {
  const store = useStore()
  const permissions = store.state.loginModule.permissions
  const formatPermission = `system:${pageName}:${handle}`
  return !!permissions.find((item) =>
    formatPermission === item
  )
}